#include<iostream>
using namespace std;

int main()
{
	int n,m,b;
	while(cin>>n)
	{
		int *a=new int[n];
		for(int i=0;i<n;i++)cin>>a[i];
		cin>>m;
		for(int i=0;i<m;i++)
		{
			cin>>b;
			int j;
			for(j=0;j<n;j++)
			{
				if(b==a[j])
				{
					cout<<"YES"<<endl;
					break;
				}
			}
			if(j>=n)cout<<"NO"<<endl;
		}
		delete []a;
	}
	return 0;
}